import java.util.Random;

public class Main {
    static Random rn = new Random(System.currentTimeMillis());
    public static int getRandomInt(int i){
        return Math.abs(rn.nextInt())%i + 1;
    }

    public void test(){
        int passengers = getRandomInt(100000);

        Solution solution = new Solution();

        double expected = nthPersonGetsNthSeat(passengers);
        double actual = solution.nthPersonGetsNthSeat(passengers);
        if(expected != actual){
            String msg = "Test Failed\n";
            msg += "Input:" + passengers + "\n";
            msg += "Expected:" + expected + "\n";
            msg += "Actual:" + actual;
            throw new RuntimeException(msg);
        }
    }

    public void testCustomized(){
        int passengers = 99999;

        Solution solution = new Solution();

        double expected = nthPersonGetsNthSeat(passengers);
        double actual = solution.nthPersonGetsNthSeat(passengers);

//        System.out.println("expected: " + expected);
//        System.out.println("actual: " + actual);

        if(expected != actual){
            String msg = "Test Failed\n";
            msg += "Input:" + passengers + "\n";
            msg += "Expected:" + expected + "\n";
            msg += "Actual:" + actual;
            throw new RuntimeException(msg);
        }
    }

    private String arrayToString(int[] num) {
        String ret = "[";
        for(int i=0; i<num.length; i++){
            if(i != num.length -1){
                ret += num[i] + ",";
            }else{
                ret += num[i];
            }
        }
        return ret + "]";
    }

    public static void main(String[] args) {
        try {
            Main main = new Main();
            for (int i = 0; i < 20; i++) {
                main.test();
            }
            main.testCustomized();
        }catch (Exception ex){
            System.out.println(ex.getMessage());
            System.exit(-1);
        }
    }
    public double nthPersonGetsNthSeat(int n) {
        return n == 1 ? 1.0 : 0.5;
    }
}
